package com.sky.service.impl;

import com.sky.entity.User;
import com.sky.mapper.UserMapper;
import com.sky.service.UserService;
import com.sky.vo.UserLoginVO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class UserServiceImpl implements UserService {
    @Autowired
    UserMapper userMapper;
    @Override
    public User login(String openid) {
        User user = userMapper.countQueryByOpenId(openid);
        if(user==null){
            user=User.builder()
                    .openid(openid).build();
            userMapper.save(user);

        }
        return user;
    }
}
